import React from "react";
import { Route, Switch, connect, Link } from "mirrorx";
import Header from "../components/header/header";
import routers from "./router-ssr";

class RouterPage extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <div>
        <Header routers={routers} />
        <div style={{ margin: "0 20px 60px" }}>
          <Switch>
            {routers.map((route, index) => (
              <Route
                key={`${index}router_render`}
                path={route.path}
                exact
                component={route.component}
              />
            ))}
          </Switch>
        </div>
      </div>
    );
  }
}

export default RouterPage;
